import http from './request'
/*****************************设备分类 *********************************************************/
// 设备分类级别
export const getEquipment = () => {
    return http({
        url: '/hongyun-training/equipment/type/getEquipment',
        method: 'GET',
    })
}
// 设备分类树
export const getEquipmentTypeTree = () => {
    return http({
        url: '/hongyun-training/equipment/type/getEquipmentTypeTree',
        method: 'GET',
    })
}
// 设备统计
export const equipmentNum = (equipmentId) => {
    return http({
        url: '/hongyun-training/equipment/type/equipmentNum?equipmentId='+equipmentId,
        method: 'GET',
    })
}
// 设备分类删除
export const deleteEquipment = (id) => {
    return http({
        url: `/hongyun-training/equipment/type/deleteEquipment/${id}`,
        method: 'DELETE'
    })
}
//增加修改设备分类
export const operateEquipment = (data) => {
    return http({
        url: '/hongyun-training/equipment/type/operateEquipment',
        method: 'POST',
        data
    })
}
//查询三级分类的分页数据
export const getEquipmentList = (data) => {
    return http({
        url: '/hongyun-training/equipment/type/getEquipmentList',
        method: 'POST',
        data
    })
}
// 表单提交
export const operateEquipmentLeaf = (data) => {
    return http({
        url: '/hongyun-training/equipment/type/operateEquipmentLeaf',
        method: 'POST',
        data
    })
}
// 三级分类设备分类删除
export const delEquipmentLeaf = (id) => {
    return http({
        url: `/hongyun-training/equipment/type/delEquipmentLeaf/${id}`,
        method: 'DELETE'
    })
}
/*****************************设备录入 *********************************************************/

//获取数据
export const getEquipmentListData = (data) => {
    return http({
        url: '/hongyun-training/equipment/getEquipmentList',
        method: 'POST',
        data
    })
}
//获取当前设备信息数据
export const getEquipmentInfo = (id) => {
    return http({
        url: '/hongyun-training/equipment/getEquipmentInfo?id='+id,
        method: 'GET',
    })
}

// 表单提交
export const operateEquipmententer = (data) => {
    return http({
        url: '/hongyun-training/equipment/operateEquipment',
        method: 'POST',
        data
    })
}
 
// 所属分类
export const getEquipments = (superId) => {
    return http({
        url: '/hongyun-training/equipment/type/getEquipments?superId='+superId,
        method: 'GET',
    })
}

//删除
export const delEquipment = (id) => {
    return http({
        url: `/hongyun-training/equipment/delEquipment/${id}`,
        method: 'DELETE'
    })
}
/*****************************保养计划 *********************************************************/
//获取数据
export const getPlans = (data) => {
    return http({
        url: '/hongyun-training/maintenance/plan/getPlans',
        method: 'POST',
        data
    })
}
// 表单提交
export const submitPlan = (data) => {
    return http({
        url: '/hongyun-training/maintenance/plan/submitPlan',
        method: 'POST',
        data
    })
}
// 设备删除
export const delPlan = (id) => {
    return http({
        url: `/hongyun-training/maintenance/plan/delPlan/${id}`,
        method: 'DELETE'
    })
}
//详情
export const getPlanInfo = (id) => {
    return http({
        url: '/hongyun-training/maintenance/plan/getPlanInfo?id='+id,
        method: 'GET',
    })
}
//保养规则计划
export const maintenanceRule = () => {
    return http({
        url: '/hongyun-training/maintenanceRule',
        method: 'GET',
    })
}
// 所属设备名称
export const getEquipmentsName = () => {
    return http({
        url: '/hongyun-training/equipment/getEquipments',
        method: 'GET',
    })
}
//保养项目
export const getProjects = () => {
    return http({
        url: '/hongyun-training/maintenance/plan/getProjects',
        method: 'GET',
    })
}
//保养项目开启状态
export const planEnable = (id,isEnable) => {
    return http({
        url: '/hongyun-training/maintenance/plan/planEnable?id='+id+'&isEnable='+isEnable,
        method: 'PUT',
    })
}
/***************************************************保养任务*************************************************************/
//获取数据
export const getTasksList = (data) => {
    return http({
        url: '/hongyun-training/maintenance/task/getTasks',
        method: 'POST',
        data
    })
}

//保养详情
export function getMaintenanceInfo(taskNo){
    return http({
        url: '/hongyun-training/app/maintenance/getMaintenanceInfo?taskNo='+taskNo,
        method: 'GET',
    })
}
/*****************************报修 *********************************************************/
//获取数据
export const getrepairlist = (data,current,size) => {
    return http({
        url: '/hongyun-training/equipmentrepair/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
}
export function equipmentrepairList(data){
    return http({
        url: '/hongyun-training/mobile/equipmentrepair/list',
        method: 'POST',
        data
    })
}
export function equipmentrepairdetail(id){
    return http({
        url: '/hongyun-training/mobile/equipmentrepair/detail?id='+id,
        // url: '/mobile/equipmentrepair/detail?id='+id,
        method: 'GET',
    })
}
/*****************************维修 *********************************************************/
//获取数据
export const equipmentMaintenancelist = (data,current,size) => {
    return http({
        url: '/hongyun-training/equipmentMaintenance/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
}
//详情
export function getRepairDetail(id){
    return http({
        url: '/hongyun-training/equipmentMaintenance/detailById?id='+id,
        // url: '/mobile/equipmentrepair/detail?id='+id,
        method: 'GET',
    })
}
/*****************************校验规则 *********************************************************/
//获取数据
export const specialequipmentverificationrules = (data,current,size) => {
    return http({
        url: '/hongyun-training/specialequipmentverificationrules/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
}
//新建或者编辑表单提交
// /specialequipmentverificationrules/submit
export function specialequipmentverificationrulessubmit(data){
    return http({
        url: '/hongyun-training/specialequipmentverificationrules/submit',
        method: 'POST',
        data
    })
}
//获取特种设备数据
export const selectEquipmentName = () => {
    return http({
        url: '/hongyun-training/specialequipmentverificationrules/selectEquipmentName',
        method: 'GET',
    })
}
//详情
export function specialeDetail(id){
    return http({
        url: '/hongyun-training/specialequipmentverificationrules/detail?id='+id,
        // url: '/mobile/equipmentrepair/detail?id='+id,
        method: 'GET',
    })
}
//删除
export const specialequipmentverificationrulesremove = (ids) => {
    return http({
        url: '/hongyun-training/specialequipmentverificationrules/remove?ids='+ids,
        method: 'POST',
    })
}
/*****************************校验任务 *********************************************************/
//获取数据
export const specialequipmentverificationtaskrecordlist = (data,current,size) => {
    return http({
        url: '/hongyun-training/specialequipmentverificationtask/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
}
// //详情
export function specialequipmentverificationtask(id){
    return http({
        url: '/hongyun-training/specialequipmentverificationtask/detail?id='+id,
        // url: '/mobile/equipmentrepair/detail?id='+id,
        method: 'GET',
    })
}
//提交数据
export function specialequipmentverificationtaskrecord(data){
    return http({
        url: '/hongyun-training/specialequipmentverificationtaskrecord/submit',
        method: 'POST',
        data
    })
}
/*****************************消防设备 *********************************************************/
//获取数据
export const firefightingequipmentlist = (data,current,size) => {
    return http({
        url: '/hongyun-training/firefightingequipment/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
}
// //详情
export function firefightingequipment(id){
    return http({
        url: '/hongyun-training/firefightingequipment/detail?id='+id,
        method: 'GET',
    })
}
//删除
export const firefightingequipmentremove = (ids) => {
    return http({
        url: '/hongyun-training/firefightingequipment/remove?ids='+ids,
        method: 'POST',
    })
}
//提交数据
export function firefightingequipmentsubmit(data){
    return http({
        url: '/hongyun-training/firefightingequipment/submit',
        method: 'POST',
        data
    })
}
//设备编号是否重复
export function firefightingequipmentexistCode(data){
    return http({
        url: '/hongyun-training/firefightingequipment/existCode',
        method: 'POST',
        data
    })
}
/*****************************备品备件 *********************************************************/
//获取数据
export const sparepartsList = (data,current,size) => {
    return http({
        url: '/hongyun-training/spareparts/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
}
// //详情
export function sparepartsdetail(id){
    return http({
        url: '/hongyun-training/spareparts/detail?id='+id,
        method: 'GET',
    })
}
//删除
export const sparepartsremove = (ids) => {
    return http({
        url: '/hongyun-training/spareparts/remove?ids='+ids,
        method: 'POST',
    })
}
//提交数据
export function sparepartssubmit(data){
    return http({
        url: '/hongyun-training/spareparts/submit',
        method: 'POST',
        data
    })
}
/*****************************工属具 *********************************************************/
//获取数据
export const industrialequipmentList = (data,current,size) => {
    return http({
        url: '/hongyun-training/industrialequipment/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
}
// //详情
export function industrialequipmentdetail(id){
    return http({
        url: '/hongyun-training/industrialequipment/detail?id='+id,
        method: 'GET',
    })
}
//删除
export const industrialequipmentremove = (ids) => {
    return http({
        url: '/hongyun-training/industrialequipment/remove?ids='+ids,
        method: 'POST',
    })
}
//提交数据
export function industrialequipmentsubmit(data){
    return http({
        url: '/hongyun-training/industrialequipment/submit',
        method: 'POST',
        data
    })
}
/*****************************工属具领用归还记录 *********************************************************/
//获取数据
export const industrialequipmentusereturnrecordList = (data,current,size) => {
    return http({
        url: '/hongyun-training/industrialequipmentusereturnrecord/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
}
// //详情
export function industrialequipmentusereturnrecorddetail(id){
    return http({
        url: '/hongyun-training/industrialequipmentusereturnrecord/detail?id='+id,
        method: 'GET',
    })
}
/*****************************备品备件出库记录 *********************************************************/
//获取数据
export const sparepartsoutboundrecordsList = (data,current,size) => {
    return http({
        url: '/hongyun-training/sparepartsoutboundrecords/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
}
// //详情
export function sparepartsoutboundrecordsdetail(id){
    return http({
        url: '/hongyun-training/sparepartsoutboundrecords/detail?id='+id,
        method: 'GET',
    })
}